package com.guigu.health.service.impl;

import com.github.pagehelper.PageHelper;
import com.guigu.health.dao.*;
import com.guigu.health.pojo.*;
import com.guigu.health.service.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName:B
 * @Description:
 * @Author:longtao
 * @Date:2021/3/24
 * @Version:1.0
 */
@Service
public class B implements A {
    public CheckGroup_Keys_CheckItemMapper checkItemMapper;
    @Autowired
    @Qualifier(value = "checkGroup_Keys_CheckItemMapper")
    public void setCheckItemMapper(CheckGroup_Keys_CheckItemMapper checkItemMapper) {
        this.checkItemMapper = checkItemMapper;
    }

    private SetMealDetailsMapper detailsMapper;
    @Autowired
    @Qualifier(value = "setMealDetailsMapper")
    public void setDetailsMapper(SetMealDetailsMapper detailsMapper) {
        this.detailsMapper = detailsMapper;
    }

    private MenuMapper menuMapper;
    @Autowired
    @Qualifier("menuMapper")
    public void setMenuMapper(MenuMapper menuMapper) {
        this.menuMapper = menuMapper;
    }

    private MemberMapper memberMapper;
    @Autowired
    @Qualifier(value = "memberMapper")
    public void setMemberMapper(MemberMapper memberMapper) {
        this.memberMapper = memberMapper;
    }

    private UserRoleMapper userRoleMapper;
    @Autowired
    @Qualifier(value = "userRoleMapper")
    public void setUserRoleMapper(UserRoleMapper userRoleMapper) {
        this.userRoleMapper = userRoleMapper;
    }

    @Override
    public List<CheckGroupResult> queryCheckGroupAllList() {
        List<CheckGroupResult> results = checkItemMapper.queryGroupAllList();
        if (results!=null){
            return results;
        }
        return null;
    }

    @Override
    public List<SetMealDetails> queryAll(Integer id) {

        return  detailsMapper.querySetMealID(id);
    }

    @Override
    public List<Menu> queryAll2(String account) {
        List<Menu> list = menuMapper.queryAll(account);
        return list;
    }

    @Override
    public List<Member> queryAll3(MemberExample example, Integer pageNum, Integer pageSzie) {
        PageHelper.startPage(pageNum,pageSzie);
        return memberMapper.selectByExample(example);
    }

/*    @Override
    public List<UserRoles> queryALl4(String id) {
        List<UserRoles> roles = userRoleMapper.queryRoles(id);
        return roles;
    }

    @Override
    public List<UserRoles> queryAll5() {
        List<UserRoles> list = userRoleMapper.queryAll();
        return list;
    }*/
}
